package network.messages;

/**
 * Message du client TCP.
 * @author Guillaume Poças & Jean-François Augé
 */
public enum KrakenClientMsg implements KrakenCommandMaker {
	KRAKEN_CLIENT("KRAKEN_CLIENT"),
	KRAKEN_SSL_CLIENT("KRAKEN_SSL_CLIENT"),
	
	COPY_FILE("COPY_FILE"),
	CREATE_FILE("CREATE_FILE"),
	CREATE_DIRECTORY("CREATE_DIRECTORY"),
	FILE_SENDED("FILE_SENDED"),
	CLEAN_FOLDER("CLEAN_FOLDER"),
	
	ENCRYPTION_DISTRIBUTION("ENCRYPTION_DISTRIBUTION"),
	ENCRYPTION_PARAMETER("ENCRYPTION_PARAMETER"),
	
	GENERATE_RSA_KEY("GENERATE_RSA_KEY"),
	GENERATE_KEY("GENERATE_KEY"),
	
	END_CLIENT("END_CLIENT"),
	END_SSL_CLIENT("END_SSL_CLIENT"),
	
	//streaming service
	ASK_FOR_TOKEN("ASK_FOR_TOKEN"),
	ASK_FOR_STREAMING("ASK_FOR_STREAMING"),
	SEND_TOKEN_FOR_VIDEO("SEND_TOKEN_FOR_VIDEO"),

	READY_FOR_STREAMING("READY_FOR_STREAMING"),
	REPORT_FPS("REPORT_FPS"),
	PLAY_STREAM("PLAY_STREAM"),
	PAUSE_STREAM("PAUSE_STREAM"),
	STOP_STREAM("STOP_STREAM"),
	
	// video
	NEW_VIDEO_REGISTERED("NEW_VIDEO_REGISTERED"),
	READY_FOR_DOWNLOAD("READY_FOR_DOWNLOAD"),
	SEND_TOKEN_FOR_DOWNLOAD("SEND_TOKEN_FOR_DOWNLOAD"),
	
	// configuration
	ASK_FOR_CONFIGURATION("ASK_FOR_CONFIGURATION"),
	
	// diffie-hellman protocole
	DIFFIE_HELLMAN_CLIENT("DIFFIE_HELLMAN_CLIENT"),
	DH_KEY("DH_KEY"),
	
	SEND_P("SEND_P"),
	SEND_G("SEND_G"),
	SEND_A("SEND_A");
	
	public String msg;

	/**
	 * Constructeur.
	 * @param msg
	 */
	private KrakenClientMsg(String msg) {
		this.msg = msg;
	}

	@Override
	public String makeCommand(String... values) {
		StringBuilder sb = new StringBuilder(msg);
		if(values!=null){
			for(String v:values){
				sb.append(" "+v);
			}
		}
		return sb.toString();
	}
	
}
